<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>后盾问答</title>
	<meta name="keywords" content="后盾问答"/>
	<meta name="description" content="后盾问答"/>
	{dream include file="../Common/header.html"}
	<link rel="stylesheet" href="{dream $smarty.const.__PUBLIC__}/Css/ask.css" />
	<!--<script src="{dream $smarty.const.__PUBLIC__}/Js/ask.js" type="text/javascript" charset="utf-8"></script>-->
	<script type="text/javascript">
		$(function(){
			//选中分类
			$('select[name=cate-one]').change(function(){
				var _this = $(this);
				//为了使第3个select选中不触发异步
				if(_this.index()>2) return;
				//获得当前选中分类的cid
				var cid = _this.val();
				$('input[name=cid]').val(cid);
				//选中第3个select表单，让其消失
				_this.next().next().hide();
				$.ajax({
					type:"post",
					url:"{dream $smarty.const.__APP__}?c=Ask&a=ajaxGetSon",
					data : {id : cid},
					dataType:'json',
					success:function(phpData){
						var nextSelect = _this.next();
						//当前的select表单的下一个select表单显示
						nextSelect.show();
						//组合option
						var optionHtml = '';
						$.each(phpData, function(k,v) {    
							optionHtml += '<option value="' + v.cid + '">' + v.title + '</option>';                                                          
						});
						nextSelect.html(optionHtml);
						
					}
				});
			})
			
			//点击“确定”关闭窗口，然后设置隐藏域
			$('#ok').click(function(){
				$('.close-window').click();
			})
		})
	</script>
<!--------------------中部-------------------->
	<div id='center'>
		<div class='send'>
			<div class='title'>
				<p class='left'>向亿万网友们提问</p>
				<p class='right'>您还可以输入<span id='num'>50</span>个字</p>
			</div>
			<form action="{dream $smarty.const.__APP__}?c=ask" method='post'>
				<div class='cons'>
					<textarea name="content"></textarea>
				</div>
				<div class='reward'>
					<span id='sel-cate' class='cate-btn'>选择分类</span>
					<ul>
						<li>
							我的金币：<span>{dream $money.point}</span>
						</li>
						<li>
					  悬赏：<select name="reward">
								<option value="0">0</option>
								<option value="5">5</option>
								<option value="10">10</option>
								<option value="15">15</option>
								<option value="20">20</option>
								<option value="20">25</option>
								<option value="30">30</option>
								<option value="20">35</option>
								<option value="20">40</option>
								<option value="20">45</option>
								<option value="50">50</option>
								<option value="20">55</option>
								<option value="20">60</option>
								<option value="20">65</option>
								<option value="20">70</option>
								<option value="20">75</option>
								<option value="80">80</option>
								<option value="100">100</option>
							</select>金币
						</li>
					</ul>
				</div>
				<input type='hidden' name='cid' value='0'/>
				<input type="submit" value='提交问题' class='send-btn'/>
			</form>
		</div>
	</div>
	<div id='category'>
		<p class='title'>
			<span>请选择分类</span>
			<a href="" class='close-window'></a>
		</p>
		<div class='sel'>
			<p>为您的问题选择一个合适的分类：</p>
			<select name="cate-one" size='16'>
				{dream foreach from=$topCate item=v}
				<option value="{dream $v.cid}">{dream $v.title}</option>
				{dream /foreach}
			</select>
			<select name="cate-one" size='16' class='hidden'></select>
			<select name="cate-one" size='16' class='hidden'></select>
		</div>
		<p class='bottom'>
			<span id='ok'>确定</span>
		</p>
	</div>
<!--------------------中部结束-------------------->

<!-- 底部 -->
	{dream include file="../Common/footer.html"}
</body>
</html>
<!-- 底部结束 -->